package com.example.myweather.utilities;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class WeatherXDotNetParseInfo {
	
	public String getCorrectTemperatureFormat(String temperature){
		return getDataIntoBrackets(temperature);
	}
	
	public String getCorrectPressureFormat(String pressure){
		return getDataIntoBrackets(pressure);
	}
		
	private String getDataIntoBrackets(String data){
		Pattern pattern = Pattern.compile("\\((.*?)\\)");
		Matcher matcher = pattern.matcher(data);
		while(matcher.find()){
		  return matcher.group(1);		
		}
	
		return "--";
	}
	
}
